<template>
  <svg
    v-if="name && name != '#'"
    class="svg-icon"
    aria-hidden="true"
    :style="{
      width: props.size + 'px',
      height: props.size + 'px',
    }"
  >
    <use :xlink:href="`#icon-${props.name}`"></use>
  </svg>
</template>
<script lang="ts">
export default defineComponent({
  name: 'SvgIcon',
  props: {
    name: {
      type: String,
      required: true,
    },
    size: {
      type: Number,
      default: 14,
    },
  },
  setup(props) {
    return {
      props,
    };
  },
});
</script>

<style scoped>
.svg-icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  fill: currentColor;
  overflow: hidden;
}
</style>
